package com.michael.study.customview

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.michael.study.customview.animation.AnimationActivity
import com.michael.study.customview.databinding.ActivityMainBinding
import com.michael.study.customview.draw.DrawGraphicActivity
import com.michael.study.library.utils.Actions

class MainActivity : AppCompatActivity(), View.OnClickListener {

    private lateinit var mBinding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(mBinding.root)
        mBinding.btnAnimation.setOnClickListener(this)
        mBinding.btnDraw.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.btn_animation -> {
                Actions.startActivity(this, AnimationActivity::class.java)
            }
            R.id.btn_draw -> {
                Actions.startActivity(this, DrawGraphicActivity::class.java)
            }
        }
    }
}
